package fr.upmc.aladyn.exemples;
import fr.upmc.aladyn.annotation.Transactionable;

@Transactionable
public class ObjetTrans extends ObjetTransSuper {
	
	private int myValue;
	private String myName;
	
	public ObjetTrans(){
		this("Toto", 0, -1);
	}
	
	public ObjetTrans(String name, int value, int valueSuper){
		super(valueSuper);
		this.myName = name;
		this.myValue = value;
	}
	
	public int getValue(){
		return this.myValue;
	}
	
	public void setValue(int newValue){
		this.myValue = newValue;
	}
	
	public String getName(){
		return this.myName;
	}
	
	public void setName(String name){
		this.myName = name;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof ObjetTrans) {
			ObjetTrans o = (ObjetTrans) obj;
			if(this.myName.equals(o.myName) && this.myValue == o.myValue) {
				return super.equals(o);
			}
		}
		return false;
	}
}
